package com.wswy.wzcx.api;


import android.util.Log;
import android.util.Pair;
import com.wswy.wzcx.BuildConfig;
import kotlin.random.Random;

public class Configs {


    static final String API_SERVER = BuildConfig.URL;


    static final String CLIENT_KEY;
    static final String APPID = "92ef86fbb9d10560";


    /**
     * 加密相关
     */
    public static final String PLATFORM = "ANDROID";

    //驾驶证等识别
    static final String OCR_API;


    //广点通广告
    public static final String GDT_APP_ID = "1107981903";
    public static final String GDT_SplashPosID = "7020246895649318";
    public static final String GDT_HOME_AD_01_ID = "7050748825045450";
    public static final String GDT_JZCF_RESULT_BANNER_ID = "1060230437178202";


    //头条广告 新闻信息流sdk
    public static final String TTAD_APPID = "5003230";
    //头条 开屏广告
    public static final String TTAD_SPLASH_AD = "803230571";
    //头条信息流广告
    public static final String TTAD_FEEDAD_AD = "903230649";
    //头条首页banner广告位
    public static final String TTAD_BANNERAD_AD = "903230804";

    //推啊广告
    //首页浮标
    public static final int TUIA_HOME_MODULE = 260258;
    //文章详情
    public static final int TUIA_WEB_FLOAT = 260256;
    //推啊开屏广告
    public static final int TUIA_SPLASH_AD = 269473;

    //腾讯防水墙id
    public static final String[] TCAPTCHA_APPS = {"2025828744","2036384129"};

    private static final Pair<String,String>[] TC_OCRS = new Pair[2];

    static {
        // ddd04e1322e55752cdff46ad0d2787c7
        CLIENT_KEY = new String(ScUtil.xor(
            new byte[]{-78, -22, -71, -31, -91, 108, 93, -26, -65, -69, -76, -14, 103, 95, -24, -17, -17, -31, -12, 53, 11, -23, -72, -68, -26, -9, 54, 10, -77, -20, -24, -32},
            new byte[]{-47, -38, -114, -42, -57, 84, 57}));

        //https://api.ai.qq.com/fcgi-bin/ocr/ocr_driverlicenseocr
        OCR_API = new String(ScUtil.xor(
            new byte[]{103, -88, 96, 118, 76, 114, -80, 33, 100, 22, -109, 104, -99, 16, -23, 105, 85, -63, -99, -56, 35, -82, -53, -53, -68, 43, -102, -69, 76, 108, 33, 27, -82, 43, 53, 103, -88, 96, 118, 76, 114, -80, 33, 100, 22, -109, 104, -99, 16, -23, 105, 85, -63, -99, -56},
            new byte[]{15, -36, 20, 6, 63, 72, -97, 14, 5, 102, -6, 70, -4, 121, -57, 24, 36, -17, -2, -89, 78, -127, -83, -88, -37, 66, -73, -39, 37, 2, 14, 116, -51, 89, 26, 8, -53, 18, 41, 40, 0, -39, 87, 1, 100, -1, 1, -2, 117, -121, 26, 48, -82, -2, -70}
        ));

        TC_OCRS[0] = Pair.create("","");

//        //2110060737
//        OCR_AI_APPID = new String(ScUtil.xor(new byte[]{34, 104, -93, -61, 36, 80, -56, -120, -26, -99},
//            new byte[]{16, 89, -110, -13, 20, 102, -8, -65, -43, -86, -19}));
//
//        //vOKzfZNm6jQuCwjD
//        OCR_AI_APPKEY = new String(ScUtil.xor(new byte[]{113, 101, 8, -85, 108, -96, 54, 121, 41, 109, 123, 54, -110, 125, -112, 60},
//            new byte[]{7, 42, 67, -47, 10, -6, 120, 20, 31}));

        String appid = new String(ScUtil.xor(new byte[]{34, 104, -93, -61, 36, 80, -56, -120, -26, -99},
            new byte[]{16, 89, -110, -13, 20, 102, -8, -65, -43, -86, -19}));
        String appKey = new String(ScUtil.xor(new byte[]{113, 101, 8, -85, 108, -96, 54, 121, 41, 109, 123, 54, -110, 125, -112, 60},
            new byte[]{7, 42, 67, -47, 10, -6, 120, 20, 31}));

        TC_OCRS[0] = Pair.create(appid,appKey);

        appid = new String(ScUtil.xor(new byte[]{80, -76, 53, -31, 68, 63, 75, 12, 62, 22},
            new byte[]{98, -123, 4, -44, 124, 11, 121, 58, 13, 46, 19, -21}));
        //vOKzfZNm6jQuCwjD
        appKey = new String(ScUtil.xor(new byte[]{-15, -101, -10, -26, -108, -99, 113, 43, 77, 87, 29, 22, -58, -81, -26, -67},
            new byte[]{-120, -34, -124, -124, -94, -52, 50, 109, 123, 25, 122, 102}));

        TC_OCRS[1] = Pair.create(appid,appKey);


        if (BuildConfig.DEBUG){
            Log.e("Configs","CLIENT_KEY:"+CLIENT_KEY);
            Log.e("Configs","OCR_API:"+OCR_API);

            for (Pair<String, String> tcOcr : TC_OCRS) {
                Log.e("Configs","OCR_AI_APPID:"+tcOcr.first);
                Log.e("Configs","OCR_AI_APPKEY:"+tcOcr.second);
                Log.e("Configs","OCR_AI_APP------");
            }


        }

    }


    static  Pair<String,String> getTcOcrConfig(){
        //return TC_OCRS[Random.Default.nextInt(0,TC_OCRS.length)];
        return TC_OCRS[0];
    }

}
